const express = require('express')
const app = express()

// 定义中间件函数
const m1 = (req, res, next) => {
    console.log('调用局部1生效的中间件');
    next()
}
const m2 = (req, res, next) => {
    console.log('调用局部2生效的中间件');
    next()
}

app.get('/', [m1, m2], (req, res) => {
    res.send('Home page')
})
app.get('/user', (req, res) => {
    res.send('User name')
})

app.listen(80, () => {
    console.log('http://127.0.0.1');
})